package com.hava.demo.springmvc.onetomany.entity;

import com.hava.jpa.IdEntity;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import java.util.Collection;

/**
 * Created by zhanpeng on 15-6-15.
 */
@Entity
@Table(name = "o2mone")
public class O2MOne extends IdEntity {

    //进行级联，小心使用删除
    @OneToMany(cascade={CascadeType.REFRESH,CascadeType.PERSIST,CascadeType.REMOVE,CascadeType.MERGE})
    private Collection<O2MMany> o2MManies;
}
